Visual Basic .NET
Nils Wiki>Formal Sciences>Computer Sciences>Software Systems>Programming languages ---- Datatypes Dim variable As String 16bit Declares the variable as a string Dim variable As Short 16bit Can hold numbers from -30k to 30k Dim variable As UShort 16bit Can hold numbers from 0 to 65k Dim variable As Integer 32bit Can hold numbers from -2G to 2G Dim variable As UInteger 32bit Can hold numbers from 0 to 4G Dim variable As Long 64bit Can hold numbers from -9a to 9a Dim variable As ULong 64bit Can hold numbers from 0 to 18a Dim variable As Single 32bit Can hold numbers from -3.4E38 to 3.4E38 with 7 decimals (Floating Point) Dim variable As Double 64bit Can hold numbers from -1.7E08 to 1.7E08 with 14 decimals (Floating Point) Dim variable As Decimal 128bit Can hold numbers from -79E27 to 79E27 with 28 decimals and digits combined Dim variable As Byte 8bit Can hold numbers from 0 to 255 Dim variable As SByte 8bit Can hold numbers from -128 to 127 Dim variable As Char 16bit Can hold characters Dim variable As Boolean 16bit variable = true or variable = false variable =''' any number(true) or variable '''= 0 (false) Dim variable As Object 32bit Any data type can be stored in an object Other Commands variable ' = “' value\word ”''' Sets the variable to value\word '''End Ends the execution Structure Dim variable As String Dim variable As Date Dim variable As Integer End Structure A structure let you make your own data type Dim variable As Structure Declares your own data type &''' String concatenation '''Const variable As datatype Declares a constant that can not change Dim variable As Integer = 1 Sets the variable immediately to equal 1 Public variable As datatype Is how to declare a variable global for all forms RadioButton1.Checked = True or False Checks\Unchecks the radiobutton Arithmetic /''' Division '''\ Whole number division Mos Remainder division (Rest) <> Not equal to >''' Greater than '''< Less than >= Grater than or equal to <= Less than or equal to _''' Brakes the line, and continue on the next line (Does not work in the middle of strings) '''a ^ b Raise a'' to the power of ''b ---- Functions variable = InputBox(variable , “ title ”) - Prompts the user with a titled window with an inputbox. variable = MsgBox(variable ,' ''buttons ''', “ title ”) - Displays a titled box with some predefined text. ---- Conjunctions IF Structures If condition1 Then Statement1 executed if condition1 is true Elseif condition2 Then Statement2 executed if condition2 is true Elseif condition3 Then Statement3 executed if condition3 is true Else Statement4 executed if none of the above is true End If Select Case Structures Select Case variable Case value1 - Statement executed if value1 matches variable Case value2 - Statement executed if value2 matches variable ---- Loops For Loop Loops as long as the counter value does not reach the end-number. For variable =''' startvalue '''To endvalue Step interval statement to be executed If condition1 Then Exit For - Ends the loop if condition1 happens Next variable - Adds one Stepvalue more to the counter value Do Loop Do While\Until Condition1 statements Loop To be sure that the Do Loop runs atleast one time use this variant. Do statements Loop While\Until condition1 End - Not nessicarily end, butsome kind of stop to the loop